class CommentsController < ApplicationController

  # POST /comments
  # POST /comments.xml
  def create
    @post = Post.find params[:post_id]
    @comment = @post.comments.build(params[:comment])

    respond_to do |format|
      if @comment.save
        format.js
        format.html { redirect_to(@post, :notice => 'Comment was successfully created.') }

      else
        format.html { render :action => "new" }

      end
    end
  end
end
